package com.sun.jdk.mytest;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sun.jdk.lambda.domain.Person;

public class PojoToJsonTest {

    public static void main(String[] args) throws JsonProcessingException {
        Person p = new Person();
        p.setName("张三");
        p.setAge(13);
        p.setHeight(171);

        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(p);
        System.out.println(json);
    }
}
